﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace JsonTest
{
    class Program
    {
        static void Main(string[] args)
        {
            /*
             * public static T? DeserializeObject<T>(string value);
             * T为要转化成的类型
             * value为json字符串
             * **/
            //Skill[] skills = JsonConvert.DeserializeObject<Skill[]>(File.ReadAllText("Skills.json"));
            List<Skill> skills = JsonConvert.DeserializeObject<List<Skill>>(File.ReadAllText("Skills.json"));
            foreach (Skill s in skills)
            {
                Console.WriteLine(s.id+","+s.name+","+s.damage);
            }
        }
    }
}
